package com.ls.controller.ai;

import com.ls.base.BaseResult;
import com.ls.base.BaseResultUtil;
import com.ls.controller.ai.model.CreateAIModel;
import com.ls.service.AIService;
import com.ls.service.impl.AIServiceImpl;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(value = "ai相关接口", tags = "ai相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/aiApp")
public class AIAppController {
    private final AIService aiService;

    @PostMapping("/chat")
    public ResultData chat(@RequestBody CreateAIModel model) {
        return aiService.generateWithQwen(model);
    }
    /**获取ai生成次数*/
    @PostMapping("/getAICount")
    public ResultData getAICount(){
        return aiService.getAICount();
    }
}
